<%-- 
    Document   : logIn
    Created on : 2011-dec-08, 15:06:34
    Author     : sa11
--%>

<%@page import="Beans.LoggedInBean"%>
<%--<%@page contentType="text/html" pageEncoding="UTF-8"%> --%>
<!DOCTYPE html>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%-- <%! LoggedInBean loggedPerson = LoggedInBean.getInstance(); %> --%>
        <jsp:useBean id="loggedPerson" class="Beans.LoggedInBean" scope="application" />

        <c:choose>
            <c:when test="${empty request.param.username}">
                            <form method = 'POST' action ="testarSub.jsp">
            <p> username <input type = 'textbox' name ='username'></input></p>     
            <p> password <input type='password' name = 'passwd'></input></p>     
        <input type = 'submit' name = 'submit' value = 'Logga In'>  
        </form>
                            </c:when>
                                <c:otherwise>
                                   <h1> 

                                </h1>
                                </c:otherwise>
                     </c:choose>
        
        
        
    <c:if test = "${pageContext.request.method == 'POST'}">
        <%!  %>
        ${loggedPerson.setusername(param.username)}
        ${loggedPerson.setPassword(param.passwd)}
        ${loggedPerson.getAliasFromDBT(param.username)}
        
    </c:if>
        
        
    </body>
</html>
